package com.aizhixin.lab.post.repository;

import com.aizhixin.lab.post.entity.Post;
import com.aizhixin.lab.project.template.entity.Project;
import javafx.geometry.Pos;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface PostRepository extends JpaRepository<Post, String> {
    Page<Post> findByDeleteFlag(Pageable page, Integer deleteFlag);
    List<Post> findByDeleteFlag(Integer deleteFlag);
    Page<Post> findByPostTypeAndDeleteFlag(Pageable page,Integer postType, Integer deleteFlag);
    Page<Post> findByPostTypeAndPostNameIsLikeAndDeleteFlag(Pageable page,Integer postType,String postName, Integer deleteFlag);
    Page<Post> findByPostTypeAndPostStatusAndDeleteFlag(Pageable page,Integer postType,Integer status, Integer deleteFlag);
    Page<Post> findByPostTypeAndPostStatusAndPostNameIsLikeAndDeleteFlag(Pageable page,Integer postType,Integer status,String postName, Integer deleteFlag);
    Page<Post> findByPostStatusAndDeleteFlag(Pageable page,Integer postStatus, Integer deleteFlag);
    Page<Post> findByPostStatusAndPostNameAndDeleteFlag(Pageable page,Integer postStatus,String postName, Integer deleteFlag);
    Page<Post> findByPostNameIsLike(Pageable page,String postName);
}
